package fa7.socialcode.service.impl;

import java.util.List;

import fa7.socialcode.dao.TopicoDao;
import fa7.socialcode.model.Topico;
import fa7.socialcode.service.TopicoManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "topicoManager")
public class TopicoManagerImpl implements TopicoManager {
    @Autowired
    TopicoDao topicoDao;

    public void setTopicoDao(TopicoDao dao) {
        this.topicoDao = dao;
    }

    public List findTopicos() {
        return topicoDao.findTopico();
    }

    public Topico findTopico(String topicoId) {
        return topicoDao.findTopicos(Long.valueOf(topicoId));
    }

    public void saveTopico(Topico topico) {
    	topicoDao.saveTopico(topico);
    }

    public void removeTopico(String topicoId) {
    	topicoDao.removeTopico(Long.valueOf(topicoId));
    }
}